//
//  HWVIPPrivilegeView.swift
//  HWanGame
//
//  Created by 王昌健 on 2022/8/29.
//  Copyright © 2022 94Wan. All rights reserved.
//

import UIKit

class HWVIPPrivilegeView: UIView {
    var logoImageView:UIImageView!
    var titleLabel:UILabel!
    var contentLabel:UILabel!
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        initUI()
        
        initFrame()
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}

extension HWVIPPrivilegeView {
    private func initUI() -> Void {
        logoImageView = UIImageView()
        logoImageView.backgroundColor = .clear
        addSubview(logoImageView)
        
        titleLabel = HWLabel.createBoldLabel(title: "", color: "#EEEEEE", font: 16*widthScale)
        addSubview(titleLabel)
        
        contentLabel = HWLabel.createLabel(title: "", color: "#888888", font: 13*widthScale)
        contentLabel.numberOfLines = 2
        addSubview(contentLabel)
    }
    
    private func initFrame() -> Void {
        logoImageView.snp.makeConstraints { make in
            make.left.top.equalToSuperview()
            make.width.height.equalTo(36*widthScale)
        }
        
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(logoImageView.snp.right).offset(5*widthScale)
            make.top.equalTo(logoImageView.snp.top).offset(2*widthScale)
            make.height.equalTo(23*widthScale)
        }
        
        contentLabel.snp.makeConstraints { make in
            make.left.equalTo(titleLabel)
            make.top.equalTo(titleLabel.snp.bottom).offset(4*widthScale)
            make.right.equalToSuperview()
            make.height.equalTo(36*widthScale)
            make.bottom.equalToSuperview()
        }
    }
}
